home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST7-21.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  648b  |  33 lines

  1. ;
  2. ; *** Listing 7-21 ***
  3. ;
  4. ; Measures the performance of multiplying by 80 with
  5. ; a table look-up.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ; Table of multiples of 80, covering the range 80 times 0
  10. ; to 80 times 479.
  11. ;
  12. Times80Table    label    word
  13. TIMES_80_SUM=0
  14.     rept    480
  15.     dw    TIMES_80_SUM
  16. TIMES_80_SUM=TIMES_80_SUM+80
  17.     endm
  18. ;
  19. Skip:
  20.     sub    ax,ax
  21.     call    ZTimerOn
  22.     rept    1000
  23.     mov    ax,10    ;so we have a constant value to
  24.             ; multiply by
  25.     mov    bx,ax    ;put the factor where we can use it
  26.             ; for a table look-up
  27.     shl    bx,1    ;times 2 for use as an index in a
  28.             ; word-sized look-up table
  29.     mov    ax,[Times80Table+bx]
  30.             ;look up the answer
  31.     endm
  32.     call    ZTimerOff
  33.